home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_healthbig.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  123 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_HealthBig.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message    activated
  14. message    touched
  15. message    taken
  16. message    user0
  17.  
  18. cog        talkCog                    local
  19.  
  20. sound    foundSnd=INXJ155.wav    local
  21.  
  22. thing    player                    local
  23.  
  24. int        bin=48                    local
  25. int        health=1000                local
  26.  
  27. int        bUnderwater                local
  28.  
  29. end
  30.  
  31. # ===================================================================
  32.  
  33. code
  34.  
  35. activated:
  36.  
  37.     player = GetSourceRef();
  38.     bUnderwater = BitTest(GetThingFlags(player), 0x02000000);
  39.  
  40.     StartCutscene(0);
  41.  
  42.     if (!bUnderwater)
  43.     {
  44.         talkCog = GetCogByIndex(0);
  45.         SendMessage(talkCog, 27);
  46.     }
  47.  
  48.     if (Rand() < 0.5)
  49.     {
  50.         SetExtCamOffset('0.15 -0.05 0.04');
  51.     }
  52.     else
  53.     {
  54.         SetExtCamOffset('-0.15 -0.05 0.04');
  55.     }
  56.     SetExtCamLookOffset('0.0 0.02 -0.01');
  57.  
  58.     return;
  59.  
  60. # -------------------------------------------------------------------
  61.  
  62. touched:
  63.  
  64.     player = GetSourceRef();
  65.  
  66.     if (GetInv(player, bin) < GetInvMax(player, bin))
  67.     {
  68.         TakeItem(GetSenderRef(), player);
  69.     }
  70.     else
  71.     {
  72.         EndCutscene();
  73.     }
  74.     
  75.     return;
  76.  
  77. # -------------------------------------------------------------------
  78.  
  79. taken:
  80.  
  81.     player = GetSourceRef();
  82.  
  83.     ChangeInv(player, bin, 1.0);
  84.     SetInvAvailable(player, bin, 1);
  85.     JonesInvItemChanged(bin);
  86.  
  87.     Sleep(1.0);
  88.  
  89.     if (!bUnderwater)
  90.         PlayVoice(player, foundSnd, 1.0, 0);
  91.  
  92.     EndCutscene();
  93.  
  94.     return;
  95.  
  96. # -------------------------------------------------------------------
  97.  
  98. user0:
  99.  
  100.     player = GetLocalPlayerThing();
  101.  
  102.     if (GetInv(player, bin) > 0)
  103.     {
  104.         if (GetHealth(player) < 1000)
  105.         {
  106.             # Clear the poisoned bit just in case
  107.             ClearActorFlags(player, 0x2000);
  108.  
  109.             # Use the health kit
  110.             HealThing(player, health);
  111.             ChangeInv(player, bin, -1);
  112.             
  113.             if (GetInv(player, bin) == 0)
  114.             {
  115.                 SetInvAvailable(player, bin, 0);
  116.             }
  117.         }
  118.     }
  119.     
  120.     return;
  121.  
  122. end
  123.